<?php
//ciao
require_once("oh.framework/oh.framework.php");



function ajax($app) {
	if ($app->ctrl == "save") {
		$nome = $_POST["nome"];
		$nome = strtolower(str_replace(" ","-",trim($nome)));
		oh("framework")->create($nome,dirname(__FILE__)."/projects");
	}
}

function main($app) {
	$p = scandir("projects");
	foreach($p as $i) {
		if ($i[0]!=".") {
			oh("dmodel")->new_object("software&uniq={$i}&name={$i}");
		}
	}
}

function projectlist() {
	$p = scandir("projects");
	echo '<ul>';
	foreach($p as $i) {
		if ($i[0]!=".") {
			echo '<li><a target="_blank" href="projects/'.$i.'">'.$i.'</a></li>';
		}
	}
	echo '</ul>';
}

oh("framework")
	->debug(true)	
	->index("projects.oh") 
	;